from django.db import models

import rtdt

class Author(models.Model):
    name = models.CharField(max_length=255)

    def __unicode__(self):
        return '%s' % self.name

    @models.permalink
    def get_absolute_url(self):
        return ('example.views.author_view', [str(self.id)])

rtdt.register(Author)

class Article(models.Model):
    title = models.CharField(max_length=255)
    authors = models.ManyToManyField(Author)

    def __unicode__(self):
        return '%s' % self.title

    @models.permalink
    def get_absolute_url(self):
        return ('example.views.article_view', [str(self.id)])

rtdt.register(Article)
